
import KafkaSink.{Base, WaterSensor}
import org.apache.flink.api.java.functions.KeySelector

/**
 *
 * @author Spring_Hu
 * @date 2021/10/10 21:26
 */
object KeyBy extends Base {
  def main(args: Array[String]): Unit = {
    run {
       ds01.keyBy(new KeySelector[WaterSensor,String] {
         override def getKey(in: WaterSensor) = {
           in.id
         }
       }).print()
  }
  }
}

